package LanQiao;

import java.util.Arrays;

public class Demo4 {
    public static void main(String[] args) {
        int[] nums = new int[]{9226, 4690, 4873, 1285, 4624, 1596,
                6982, 590, 8806, 121, 8399,
                8526, 5426, 64, 9655, 7705,
                3929, 3588, 7397, 8020, 1311,
                5676, 3469, 2325, 1226, 8203,
                9524, 3648, 5278, 8647};

        Arrays.sort(nums);

        System.out.println(nums[14]);
        System.out.println(nums[15]);

        int ret1 = 0;
        for (int i = 0; i < 30; i++) {
            ret1 += (int) Math.pow(nums[14] ^ nums[1], 2);
        }
        System.out.println(ret1);

        int ret2 = 0;
        for (int i = 0; i < 30; i++) {
            ret1 += (int) Math.pow(nums[15] ^ nums[1], 2);
        }
        System.out.println(ret2);
    }
}
